package com.suyl.candy.model.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.suyl.candy.model.entity.BussAccount;
import com.suyl.candy.model.entity.StatisticsAccount;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author suyl
 * @since 2020-04-21
 */
public interface BussAccountMapper extends BaseMapper<BussAccount> {

    /* 贷款总额 */
    public BigDecimal getTotalLoans();

    /* 截止今天已还总额 */
    public BigDecimal getTotalAmountRepaid();

    /* 本月贷款总额 */
    public BigDecimal getTotalLoansMonth();

    /* 截止今天本月已还总额 */
    public BigDecimal getTotalAmountRepaidMonth();

    /* 截止今天各类型已还多少期多少钱 */
    public List<StatisticsAccount> getTotalAmountRepaidByType();

    /* 截止今天各类型未还多少期多少钱 */
    public List<StatisticsAccount> getTotalAmountNotByType();

    /* 每个月份需要还多少钱 */
    public List<StatisticsAccount> getByMonth();

    /* 截止当前已还，每个月还多少 */
    public List<StatisticsAccount> getTotalAmountRepaidByMonth();

    /* 截止当前未还，每个月还多少 */
    public List<StatisticsAccount> getTotalAmountNotByMonth();

    /* 本月各类型需还比例 */
    public List<StatisticsAccount> getCurrentMonthGroupByType();

    /* 最近times次待还款 */
    public List<BussAccount> getLatelyNNot(@Param("times") int times);

    /* 最近times次已还款 */
    public List<BussAccount> getLately(@Param("times") int times);
}
